package org.example.controller;

import dev.langchain4j.model.chat.ChatLanguageModel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class ChatController {

	@Autowired
	ChatLanguageModel chatLanguageModel;

	@GetMapping("/chat")
	public String model(@RequestParam(value = "mes", defaultValue = "Hello") String message) 
	{
		return chatLanguageModel.chat(message);
	}
}